﻿CREATE FUNCTION [dbo].[fn_sysColumnDescription](@TableName [sysname], @ColumnName [sysname])
RETURNS [nvarchar](255) WITH EXECUTE AS CALLER
AS 
BEGIN 
	DECLARE @s nvarchar(255)
	SELECT @s = cast(p.value as nvarchar(255))  
	FROM sysobjects o, syscolumns c, sysproperties p 
	WHERE o.id=p.id
	  and o.xtype='U'
	  and c.id=o.id
	  and c.colid=p.smallid
	  and o.name=@TableName
	  and c.name=@ColumnName
	RETURN @s
END


